"""
    对rdd执行map操作，然后进行【解除嵌套】操作
"""
from pyspark import SparkConf, SparkContext
import os

if __name__ == '__main__':
    os.environ['PYSPARK_PYTHON'] = "D:/Python/Python310/python.exe"
    conf = SparkConf().setMaster("local[*]").setAppName("create rdd")
    sc = SparkContext(conf=conf)
    rdd = sc.parallelize(["a b c d", "q a z", "w s c"])

    print(rdd.flatMap(lambda x: x.split(' ')).collect())
